package com.dmwork.service.interaction.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dmwork.service.interaction.entity.CmsCourse;
import com.dmwork.service.interaction.entity.vo.CmsCourseVo;
import com.dmwork.service.interaction.mapper.CmsCourseMapper;
import com.dmwork.service.interaction.service.CmsCourseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 李天
 * @since 2021-12-13
 */
@Transactional
@Service
public class CmsCourseServiceImpl extends ServiceImpl<CmsCourseMapper, CmsCourse> implements CmsCourseService {

    @Autowired
    private CmsCourseMapper cmsCourseMapper;

    @Override
    public Page<CmsCourse> getCourseList(Integer page, Integer limit) {
        Page<CmsCourse> selectPage=new Page<>(page, limit);
        return baseMapper.selectPage(selectPage, new QueryWrapper<>());
    }

    @Override
    public List<CmsCourseVo> getCourseList() {
        return cmsCourseMapper.getCourseList();
    }
}
